﻿using System;
class Task2
{
    bool isprime(int x)
    {   
        for(int i=2; i*i<=x; i++)
        {
            if (x % i == 0)
            {
                return false;
            }
        }
        return true;
    }
    public bool getAllPrime(int min,int max,List<int> list)
    {   
        if(min>max) return false;
        for(int i = min; i <= max; i++)
        {
            if (isprime(i))
            {
                list.Add(i);
            }
        }
        return true;
    }
}
class Test
{
    static void Main(string[] args)
    {
        Task2 task2 = new Task2();
        List<int> list = new List<int>();
        task2.getAllPrime(2,30,list);
        foreach(int i in list)
        {
            Console.WriteLine(i);
        }
    }
}
